package com.neuedu.controller;

import com.neuedu.entity.Nursecontent;
import com.neuedu.service.NurselevelitemService;
import com.neuedu.vo.ResultJson;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 护理等级项目对应表 前端控制器
 * </p>
 *
 * @author wangyu
 * @since 2025-10-23
 */
@RestController
@RequestMapping("/nurselevelitem")
public class NurselevelitemController {
    @Resource
    NurselevelitemService nurselevelitemService;
    @PostMapping("/add")
    ResultJson<Boolean> add(Integer levelId, Integer[] itemIds) {
        return ResultJson.success(nurselevelitemService.add(levelId, itemIds), "添加护理等级项目成功");
    }
    @GetMapping("/list")
    ResultJson<List<Integer>> list(Integer levelId) {
        return ResultJson.success(nurselevelitemService.list(levelId));
    }
    @GetMapping("/getItem")
    ResultJson<List<Nursecontent>> getItem(Integer levelId) {
        return ResultJson.success(nurselevelitemService.getItem(levelId));
    }
}
